<template>
	<view>
		<view class="text-center">
			<image class="cu-avatar xl round margin-top" src="/src/static/logo.png" mode=""></image>
			<view class="margin text-xl">
				登录账号
			</view>
			<view class="">
				在此处登录您的账户
			</view>
		</view>
		<view class="padding-lr margin-lr">
			<view class="margin-tb">
				账号
			</view>
			<custom-input v-model="username" holder="请输入账号">
				<text class="iconfont icon-wode"></text>
			</custom-input>
		</view>
		<view class="padding-lr margin-lr">
			<view class="margin-tb">
				密码
			</view>
			<custom-input v-model="password" holder="请输入密码" type="password">
				<text class="iconfont icon-mima"></text>
			</custom-input>
		</view>
		<view class="padding margin-top">
			<button class="cu-btn bg-orange block " @click="handleLogin">
				登录
			</button>
		</view>
		<navigator class="padding text-center color-orange" url="/pages/account/register">
			去注册
		</navigator>
	</view>
</template>

<script setup lang="ts">
import { ref, type Ref } from 'vue';
import {useStore} from 'vuex'
const username:Ref<string> = ref('')
const password:Ref<string> = ref('')
const store = useStore()
const handleLogin = ()=>{
	store.dispatch('user/loginAction',{
		"username":username.value,
		"password":password.value,
	})
}
</script>

<style lang="scss">
page{
	background-color: #fff;
}       
</style>
